package org.poem;

import org.poem.service.ScopePrototypeDemoService;
import org.poem.service.ScopeSingletonService;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;


@SpringBootApplication
public class Main  {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext configApplicationContext = new AnnotationConfigApplicationContext(Main.class);
        ScopePrototypeDemoService scopePropertyDemoService1 = configApplicationContext.getBean(ScopePrototypeDemoService.class);
        ScopeSingletonService scopeSingletonService1 = configApplicationContext.getBean(ScopeSingletonService.class);


        ScopePrototypeDemoService scopePropertyDemoService2 = configApplicationContext.getBean(ScopePrototypeDemoService.class);
        ScopeSingletonService scopeSingletonService2 = configApplicationContext.getBean(ScopeSingletonService.class);

        System.err.println("property equals:" + scopePropertyDemoService1.equals(scopePropertyDemoService2));
        System.err.println("singleton equals:" + scopeSingletonService1.equals(scopeSingletonService2));
    }
}
